package com.wuba.baojie.enums;

public enum ErrorEnums {
    PHONE_NOT_VALITATE                  ("0001","手机号不符合规则"),
    CODES_NOT_NULL                      ("0002","验证码不得为空"),
    CODES_NOT_RIGHT                     ("0003","验证码错误"),
    CODES_OVER_TIME                     ("0004","验证码过期"),
    USERID_NOT_NULL                     ("0005","userid不能为空"),
    CHANNELID_NOT_NULL                  ("0006","频道id不能为空"),
    MAC_NOT_NULL                        ("0007","MAC地址不能为空"),
    CODES_FREQUENTLY                        ("0008","验证码发送频繁"),
    ERROR_DATA                        ("0009","数据异常"),
    COURSE_NOT_START                        ("0010","课程尚未开始"),
    ERROR_SYSTEM                        ("0011","系统异常"),
    ;
    private String ecode;

    private String emsg;

    ErrorEnums(String ecode, String emsg) {
        this.ecode = ecode;
        this.emsg = emsg;
    }

    public String getEcode() {
        return ecode;
    }

    public String getEmsg() {
        return emsg;
    }

    public static ErrorEnums statOf(String ecode) {
        for (ErrorEnums state : values())
            if (state.getEcode().equals(ecode))
                return state;
        return null;
    }
}
